﻿namespace MicroCloud.Systems
{
    public interface IDictService
    {
        #region Dict
        /// <summary>
        /// 获取 实体查询数据集
        /// </summary>
        IQueryable<Dict> Dicts { get; }

        /// <summary>
        /// 根据编号查找
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult<DictOutputDto>> FindDictById(Guid id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateDicts(params DictInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateDicts(params DictInputDto[] dtos);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="ids">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> DeleteDicts(params Guid[] ids);

        #endregion

        #region DictEntry
        /// <summary>
        /// 获取 实体查询数据集
        /// </summary>
        IQueryable<DictEntry> DictEntrys { get; }

        /// <summary>
        /// 根据编号查找
        /// </summary>
        /// <param name="id">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult<DictEntryOutputDto>> FindDictEntryById(Guid id);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> CreateDictEntrys(params DictEntryInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dtos">DTO信息</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> UpdateDictEntrys(params DictEntryInputDto[] dtos);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="ids">数据实体编号</param>
        /// <returns>业务操作结果</returns>
        Task<OperationResult> DeleteDictEntrys(params Guid[] ids);

        #endregion
    }
}